<?php
/* Clase del formulario FrmUsers que permite administrar usuarios de SCI
 */
class FrmUsersRegister{
	private $setter;
	private $dbOperator;
	
	private $easyForm;
	private $frmTableUsers;

	//private $divUsersTable;
	
		
	function FrmUsersRegister(){
		$this->setter=new Setter("../../Config");
		$this->dbOperator=new DbOperator();
		$this->dbOperator=new DbOperator($this->setter->getDataBaseHost(),$this->setter->getDataBaseUserName(),$this->setter->getDataBaseName(),$this->setter->getDataBasePassword());
		$this->dbOperator->connect();
		$roles=$this->dbOperator->consult("SELECT nombre FROM roles", "yes");
				
		$this->easyForm=new EasyForm("usersForm", "usersForm","get","../../Events/Invitados/EventsFrmUsersRegister.php","Registro de nuevo usuario:","","","","");
		$this->easyForm->addInput(1,"Cedula:","cedula","cedula","","","","","form","","",array());
		$this->easyForm->addInput(1,"Nombre:","nombre","nombre","","","","","form","","",array());
		$this->easyForm->addInput(1,"Apellido:","apellido","apellido","","","","","form");
		$this->easyForm->addInput(1,"Nick:","nick","nick","","","","","form");
		$this->easyForm->addInputPassword(1,"Password:","password","password","","","","","form");
		$this->easyForm->addInputPassword(1,"Confirmar Password:","password2","password2","","","","","form");
		$this->easyForm->addSelectionList(1,"Rol:","rol","rol","","","","yes");
		$this->easyForm->setItem("Rol:",$roles);
		$this->easyForm->addInput(1, "Telefono:","telefono","telefono","","","","","form");
		$this->easyForm->addInput(1, "Dirección:","direccion","direccion","","","","","form");
		$this->easyForm->addInput(1, "Ciudad:","ciudad","ciudad","","","","","form");
		$this->easyForm->addInput(1, "Pais:","pais","pais","","","","","form");
		$this->easyForm->addInput(1, "Email:","email","email","","","","","form");	
		$this->easyForm->addSimpleLabel(1,"Espacio:","Espacio","",array());
		$this->easyForm->addButton(12,"","RegistrarU","RegistrarU","registrarU","registrar","registrar usuario","button","","button","","Registrar usuario","","","0", array("onclick"=>"GETMethodSend('cedula','nombre','apellido','nick','password','password2','rol','telefono','direccion', 'ciudad', 'pais', 'email','RegistrarU','tableUsers','../../Events/Invitados/EventsFrmUsersRegister.php')"));		
		$this->frmTableUsers=new Div("tableUsers","tableUsers","tableDB",array());
	}
	function show(){
		$this->easyForm->show(2,10);
		$this->frmTableUsers->start();
		
		$this->frmTableUsers->end();
	}
}
?>
